/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package group2assignone.ucm.manager;

import group2assignone.func.UCCtoALAdapter;
import group2assignone.model.Flight;
import group2assignone.ucm.UCController;
import group2assignone.view.manager.AddPromotionView;

/**
 *
 * @author Brad
 */
public class UCUIAddPromotion implements UCController{

    private AddPromotionView promoView = new AddPromotionView();

    /**
     * initialises edit view
     * @param view
     */
    public UCUIAddPromotion(AddPromotionView view) {
        this.promoView = view;
        promoView.go();
    }

    @Override
    public void run() {
        Flight f = new Flight();
        //boolean exists = false;

        UCAddPromotionSearch ucps = new UCAddPromotionSearch(promoView, f);
        promoView.setSearchAL(new UCCtoALAdapter(ucps));


        UCAddPromotionSave ucaps = new UCAddPromotionSave(promoView, f);
        promoView.setSaveAL(new UCCtoALAdapter(ucaps));

        UCAddPromotionCancel ucapc = new UCAddPromotionCancel(promoView);
        promoView.setCancelAL(new UCCtoALAdapter(ucapc));


    }
}
